﻿Imports System.Web

Namespace AboutDNN.DNNMVC


    ' This interface is used to abastact the HttpContext property bag (Items) cache
    ' This is done to faciliate testing by providing the decoupling necesary
    Public Interface IContextCache
        Default Property Item(ByVal key As String) As Object
        ReadOnly Property Items() As Hashtable 'Dictionary(Of String, Object)
    End Interface

#Region "ASPContextCache"

    Public Class ASPContextCache
        Implements IContextCache

        Default Public Property Item(ByVal key As String) As Object Implements IContextCache.Item
            Get
                Return HttpContext.Current.Items(key)
            End Get
            Set(ByVal value As Object)
                HttpContext.Current.Items(key) = value
            End Set
        End Property

        Public ReadOnly Property Items() As Hashtable Implements IContextCache.Items
            Get
                Return HttpContext.Current.Items
            End Get
        End Property
    End Class

#End Region


End Namespace